]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
portalHelper: Fix portals which require a new window to be loaded
authorCatalin Iacob <iacobcatalin@gmail.com>
Fri, 24 Mar 2017 17:57:29 +0000 (18:57 +0100)
committerBastien Nocera <hadess@hadess.net>
Thu, 6 Apr 2017 10:28:43 +0000 (12:28 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=759044

js/portalHelper/main.js

index 2928c761a48d3180c558782d36d10729aa7b8139..b721f6a0f0a865cad42d0c77f247ec11e915d9cf 100644 (file)
@@ -215,6 +215,18 @@ const PortalWindow = new Lang.Class({
 
     _onDecidePolicy: function(view, decision, type) {
         if (type == WebKit.PolicyDecisionType.NEW_WINDOW_ACTION) {
+            let navigationAction = decision.get_navigation_action();
+            if (navigationAction.is_user_gesture()) {
+                // Even though the portal asks for a new window,
+                // perform the navigation in the current one. Some
+                // portals open a window as their last login step and
+                // ignoring that window causes them to not let the
+                // user go through. We don't risk popups taking over
+                // the page because we check that the navigation is
+                // user initiated.
+                this._webView.load_request(navigationAction.get_request());
+            }
+
             decision.ignore();
             return true;
         }